package com.lcf.framework.model;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * 实体基类 无租户id
 *
 * @author lcf
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class BaseNoTenantModel<T extends BaseNoTenantModel<T>> extends Model<T> {
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @TableField(fill = FieldFill.INSERT)
    private Long createBy;

    @TableField(fill = FieldFill.UPDATE)
    private LocalDateTime updateTime;

    @TableField(fill = FieldFill.UPDATE)
    private Long updateBy;

    //乐观锁版本号字段
    @Version
    @TableField(fill = FieldFill.INSERT)
    private Integer version;

    private String traceId;

    @TableLogic
    @TableField(fill = FieldFill.INSERT)
    private Integer delFlag;
}
